export default function (context) {
  const { route, redirect, beforeNuxtRender, nuxtState, $axios, app, from } = context
  const path = route.path
  // console.log('===mmiddleware===', context.store.getters.title)
  // context.store.commit('setTitle', '哈哈哈')
  // context.store.commit('setTitle', 'ffffff')
  // context.store.commit('setTitle', 'ffff')
  // console.log(' context.store.getters.title', context.store.getters.title)
  // console.log('【middle】context.store.getters.pageTitle', context.store.getters.pageTitle)
  // context.store.commit('setMiddleTitle', 'middle-' + new Date())
  // console.log('【middle】context.store.getters.pageTitle', context.store.getters.pageTitle)

  context.store.commit('setAccessControlInfo', 'hahahah')
  // app.router.push({ path: '/DemoMixin2', params: { args0: 123 } })
  // console.log('route.name', route.name)
  // console.log('route.path', route.path)
  // if (process.client) {
  //   const { from, nuxtState } = context
  //   console.log('nuxtState', nuxtState)
  //   console.log('from', from)

  // }

  if (!context.store.getters.pageTitle) {
    console.log('重定向')
    // redirect({ path: '/DemoMixin2', params: { args0: 123 } })
  }
}

